home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / vsc92nov.zip / Makefile < prev    next >
Makefile  |  1992-11-02  |  11KB  |  316 lines

  1. #
  2. # This is the Makefile for the Scheme implementation ``vscm'' by
  3. # Matthias Blume.  It requires the existence of an ANSI-C-System.
  4. # Use the make-variables below to adapt to your local needs.
  5. #
  6.  
  7. # Use a Bourne-Shell-like shell:
  8.  
  9.                         SHELL = /bin/sh
  10.  
  11. # The ``delete'' command:
  12.  
  13.                        DELETE = rm
  14.                   FORCEDELETE = $(DELETE) -f
  15. # The SCCS ``get'' command:
  16.                           GET = get
  17.  
  18. # The librarian ``ar'':
  19.                            AR = ar
  20.  
  21. # The next section describes your local C system.
  22. # CC is the name of your C-Compiler.  Use gcc, if available.  You MUST
  23. #       use an ANSI-C-Compiler.
  24. # OPTFLAGS (e.g. ``-O'', ``-O2'', ``-DNDEBUG'')
  25. #    instruct the compiler to produce optimized code. 
  26. #       With gcc NEVER use plain ``-O'' (there is a bug...)!
  27. # WARNFLAGS (e.g. ``-Wall'') are used to choose the warn level.
  28. # DEBUGFLAGS (e.g. ``-g'', ``-DDEBUG'')
  29. #    instruct the compiler to include debugging information and/or code.
  30. # EXTRACFLAGS (e.g. ``-Iincldir'') are extra flags passed to the compile phase.
  31. # EXTRALDFLAGS (e.g. ``-Llibdir'') are extra flags passed to the link phase.
  32. # EXTRALIBS (e.g. ``-lcposix'') are extra libraries, which might be necessary.
  33. # RANLIB is the library randomizer (normally ``ranlib'') or a null command
  34. #    if ranlib is not necessary (e.g. ``:'')
  35. # ECHO_N is yes, if you should use ``echo -n'' instead of ``echo ... \c''
  36. # IDENT_PREPROC is ``unmake-ident'' for compilers, which are not capable of
  37. #       dealing with the GNU-CC ``# ident'' directive, otherwise it should
  38. #       be a null command (see RANLIB).
  39.  
  40.                            CC = gcc
  41.                      OPTFLAGS = -O2 -DNDEBUG
  42.                     WARNFLAGS = -Wall -Wmissing-prototypes
  43.                    DEBUGFLAGS = -g
  44.                   EXTRACFLAGS =
  45.                  EXTRALDFLAGS =
  46.                     EXTRALIBS =
  47.                        RANLIB = ranlib
  48.                        ECHO_N = yes
  49.                 IDENT_PREPROC = :
  50.  
  51. # The next section gives examples for systems, where I know, how it works:
  52. # 1. DECstation (ULTRIX) using gcc (v2.1):
  53. ##                           CC = gcc
  54. ##                     OPTFLAGS = -O2 -DNDEBUG
  55. ##                    WARNFLAGS = -Wall
  56. ##                   DEBUGFLAGS =
  57. ##                  EXTRACFLAGS =
  58. ##                 EXTRALDFLAGS =
  59. ##                    EXTRALIBS =
  60. ##                       RANLIB = ranlib
  61. ##                       ECHO_N = yes
  62. ##                IDENT_PREPROC = :
  63. #
  64. # 2. HP series 800 or 700, HP-UX:
  65. ##                           CC = cc -Aa
  66. ##                     OPTFLAGS = -O -DNDEBUG
  67. ##                    WARNFLAGS =
  68. ##                   DEBUGFLAGS =
  69. ##                  EXTRACFLAGS = -DEXIT_VOLATILE
  70. ##                 EXTRALDFLAGS =
  71. ##                    EXTRALIBS =
  72. ##                       RANLIB = ranlib
  73. ##                       ECHO_N = no
  74. ##                IDENT_PREPROC = unmake-ident
  75. #
  76. # 3. ISC 3.2 using gcc (v2.2.2)
  77. ##                           CC = gcc
  78. ##                     OPTFLAGS = -O2 -DNDEBUG
  79. ##                    WARNFLAGS = -Wall
  80. ##                   DEBUGFLAGS =
  81. ##                  EXTRACFLAGS =
  82. ##                 EXTRALDFLAGS =
  83. ##                    EXTRALIBS = -lcposix
  84. ##                       RANLIB = :
  85. ##                       ECHO_N = yes
  86. ##                IDENT_PREPROC = :
  87. # 4. experimental (lcc)
  88. ##                           CC = lcc
  89. ##                     OPTFLAGS = -DNDEBUG
  90. ##                    WARNFLAGS =
  91. ##                   DEBUGFLAGS =
  92. ##                  EXTRACFLAGS =
  93. ##                 EXTRALDFLAGS =
  94. ##                    EXTRALIBS =
  95. ##                       RANLIB = ranlib
  96. ##                       ECHO_N = yes
  97. ##                IDENT_PREPROC = :
  98.  
  99. # Don't fool around with stuff below this line...
  100.  
  101. .DEFAULT:
  102.     @echo I hope, making $< is not necessary...
  103.  
  104. CFLAGS  = $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS) $(EXTRACFLAGS)
  105. LDFLAGS = $(OPTFLAGS) $(DEBUGFLAGS) $(EXTRALDFLAGS)
  106. CLFLAGS = $(CFLAGS) $(EXTRALDFLAGS)
  107. LIBS    = $(EXTRALIBS)
  108.  
  109. OBJECTS =    \
  110.     storage.o storext.o identifier.o reader.o keyword.o io.o \
  111.     Boolean.o Character.o Cons.o Vector.o String.o \
  112.     Procedure.o Promise.o Symbol.o Cont.o \
  113.     Primitive.o Code.o Number.o Fixnum.o Port.o \
  114.     except.o main.o list-prim.o misc-prim.o bool-prim.o equiv-prim.o \
  115.     sym-prim.o num-prim.o vect-prim.o contr-prim.o sc-prim.o \
  116.     tmpstring.o gcstat.o
  117.  
  118. TMPLIBS = non-ansi-lib
  119.  
  120. .PRECIOUS:    $(TMPLIBS)
  121.  
  122. all:    unmake-ident scheme .scheme-boot scmcomp/cfilt.boot
  123.  
  124. unmake-ident:    s.unmake-ident
  125.     -if [ -f s.unmake-ident ]; then $(GET) s.unmake-ident; else exit 0; fi
  126.     chmod +x unmake-ident
  127.  
  128. make-asm:    s.make-asm
  129.     -if [ -f s.make-asm ]; then $(GET) s.make-asm; else exit 0; fi
  130.     chmod +x make-asm
  131.  
  132. #
  133. # Dependencies:
  134. #
  135.  
  136. Boolean.o:    storext.h Boolean.h storage.h type.h identifier.h except.h 
  137. Character.o:    storext.h Character.h storage.h type.h identifier.h except.h 
  138. Code.o:        storext.h Code.h storage.h Vector.h Cont.h Symbol.h \
  139.         String.h Cons.h Boolean.h Procedure.h Promise.h Primitive.h \
  140.         Number.h identifier.h type.h except.h keyword.h speccont.h \
  141.         mode.h
  142. Cons.o:        storext.h Cons.h storage.h identifier.h keyword.h Boolean.h \
  143.         type.h
  144. Cont.o:        storext.h Cont.h storage.h Vector.h Code.h \
  145.         identifier.h stack-t.h type.h except.h speccont.h
  146. Fixnum.o:    ushort-digs.h storext.h Fixnum.h storage.h identifier.h \
  147.         type.h Cont.h Vector.h Code.h cont-hex.h except.h
  148. Number.o:    storext.h Number.h storage.h Fixnum.h identifier.h \
  149.         Cont.h Vector.h Code.h type.h except.h
  150. Port.o:        storext.h Port.h storage.h identifier.h except.h type.h
  151. Primitive.o:    storext.h Primitive.h storage.h identifier.h type.h except.h \
  152.         builtins.tab
  153. Procedure.o:    storext.h Procedure.h storage.h identifier.h
  154. Promise.o:    storext.h Promise.h storage.h identifier.h
  155. String.o:    storext.h String.h storage.h identifier.h type.h except.h
  156. Symbol.o:    storext.h Symbol.h storage.h Primitive.h identifier.h type.h \
  157.         except.h
  158. Vector.o:    storext.h Vector.h storage.h identifier.h type.h except.h
  159. bool-prim.o:    Boolean.h storage.h Cont.h Vector.h Code.h builtins.tab
  160. contr-prim.o:    Cont.h storage.h Vector.h Code.h Procedure.h \
  161.         Primitive.h Promise.h Boolean.h Cons.h except.h type.h \
  162.         builtins.tab
  163. equiv-prim.o:    Cont.h storage.h Vector.h Code.h Boolean.h storext.h \
  164.         builtins.tab
  165. except.o:    Cont.h storage.h Vector.h Code.h String.h except.h \
  166.         m-except.h io.h storext.h type.h mode.h
  167. gcstat.o:    storage.h Cont.h Vector.h Code.h Number.h \
  168.         speccont.h mode.h except.h
  169. identifier.o:    storage.h identifier.h type.h Boolean.h Character.h Cons.h \
  170.         Procedure.h Promise.h String.h Symbol.h Vector.h \
  171.         Cont.h Code.h Primitive.h Port.h Number.h Fixnum.h
  172. io.o:        io.h Port.h storage.h reader.h storext.h Cont.h \
  173.         Vector.h Code.h Boolean.h String.h Character.h Number.h \
  174.         mode.h type.h tmpstring.h except.h builtins.tab
  175. keyword.o:    keyword.h storage.h Symbol.h
  176. list-prim.o:    Cont.h storage.h Vector.h Code.h Boolean.h Cons.h \
  177.         Number.h storext.h type.h except.h builtins.tab
  178. main.o:        main.h std-ansi.h storage.h storext.h keyword.h reader.h \
  179.         except.h Cont.h Vector.h Code.h Boolean.h Symbol.h \
  180.         io.h m-except.h speccont.h
  181. misc-prim.o:    storage.h Cont.h Vector.h Code.h Number.h String.h \
  182.         Boolean.h Primitive.h type.h tmpstring.h mode.h except.h \
  183.         builtins.tab
  184. mkalign.o:    
  185. mkconthex.o:    
  186. mkdigs.o:    
  187. num-prim.o:    Cont.h storage.h Vector.h Code.h Number.h Fixnum.h \
  188.         Boolean.h Cons.h storext.h type.h except.h builtins.tab
  189. reader.o:    reader.h keyword.h Cont.h storage.h Vector.h Code.h \
  190.         type.h Cons.h Character.h String.h Symbol.h Boolean.h \
  191.         Fixnum.h Number.h except.h
  192. storage.o:    align.h storage.h storage-t.h except.h
  193. storext.o:    storage.h storext.h
  194. sc-prim.o:    String.h storage.h Character.h Boolean.h Cont.h \
  195.         Vector.h Code.h Number.h Cons.h type.h except.h \
  196.         builtins.tab
  197. sym-prim.o:    storage.h Cont.h Vector.h Code.h Symbol.h String.h \
  198.         Boolean.h type.h except.h tmpstring.h builtins.tab
  199. tmpstring.o:    tmpstring.h except.h
  200. vect-prim.o:    Code.h storage.h Vector.h Cont.h Boolean.h Number.h \
  201.         Cons.h type.h except.h builtins.tab
  202. tstorage.o:    main.h std-ansi.h storage.h
  203.  
  204. #
  205. # Rules:
  206. #
  207.  
  208. objects: $(OBJECTS)
  209.  
  210. align.h: mkalign
  211.     mkalign >align.h
  212.  
  213. ushort-digs.h: mkdigs
  214.     mkdigs >ushort-digs.h
  215.  
  216. cont-hex.h: mkconthex
  217.     mkconthex >cont-hex.h
  218.  
  219. .c.o:
  220.     $(IDENT_PREPROC) $<
  221.     $(CC) $(CFLAGS) -c $<
  222.  
  223. .c~.o:
  224.     -if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
  225.     $(IDENT_PREPROC) $*.c
  226.     $(CC) $(CFLAGS) -c $*.c
  227.  
  228. .c:
  229.     $(IDENT_PREPROC) $<
  230.     $(CC) -o $* $(CLFLAGS) $< $(LIBS)
  231.  
  232. .c~:
  233.     -if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
  234.     $(IDENT_PREPROC) $*.c
  235.     $(CC) -o $* $(CLFLAGS) $*.c $(LIBS)
  236.  
  237. .h~.h:
  238.     -if [ -f s.$*.h ]; then $(GET) s.$*.h; else exit 0; fi
  239.  
  240. .c~.c:
  241.     -if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
  242.  
  243. builtins.tab:    s.builtins.tab
  244.     -if [ -f s.builtins.tab ]; then $(GET) s.builtins.tab; else exit 0; fi
  245.  
  246. non-ansi-lib:    non-ansi-lib(fileno.o)
  247.     $(RANLIB) non-ansi-lib
  248.     @echo non-ansi-lib is now up to date
  249.  
  250. .c.a:
  251.     $(IDENT_PREPROC) $<
  252.     $(CC) $(CFLAGS) -c $<
  253.     $(AR) rv $@ $*.o
  254.     $(FORCEDELETE) $*.o
  255.  
  256. .c~.a:
  257.     -if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
  258.     $(IDENT_PREPROC) $*.c
  259.     $(CC) $(CFLAGS) -c $*.c
  260.     $(AR) rv $@ $*.o
  261.     $(FORCEDELETE) $*.o
  262.  
  263. # Delete all temporary stuff:
  264. clean:
  265.     $(FORCEDELETE) mkalign mkdigs mkconthex *.o tstorage \
  266.         align.h ushort-digs.h cont-hex.h *.out core \
  267.         *.pixie *.Addrs *.Counts *.a \
  268.         scmcomp/oldfilt.boot scmcomp/oldboot.asm
  269.  
  270. # Delete stuff related to this machine architecture:
  271. archclean: clean
  272.     $(FORCEDELETE) scheme .scheme-boot scmcomp/boot.asm
  273.  
  274. # Delete everything, which is not absolutely necessary to bootstrap from:
  275. distclean: archclean
  276.     $(FORCEDELETE) scmcomp/repl.boot
  277.  
  278. scheme:    $(OBJECTS) $(TMPLIBS)
  279.     $(CC) -o scheme $(LDFLAGS) $(OBJECTS) $(LIBS) $(TMPLIBS)
  280.  
  281. .scheme-boot: scmcomp/repl.boot
  282.     cp scmcomp/repl.boot .scheme-boot
  283.  
  284. scmcomp/cfilt.boot:    format.time scmcomp/boot.asm scmcomp/cfilt-ml.asm
  285.     cat scmcomp/boot.asm scmcomp/cfilt-ml.asm | \
  286.         scheme -b - -a - -d scmcomp/cfilt.boot
  287.  
  288. scmcomp/repl.boot:    format.time scmcomp/boot.asm scmcomp/repl-ml.asm
  289.     cat scmcomp/boot.asm scmcomp/repl-ml.asm | \
  290.         scheme -b - -a - -d scmcomp/repl.boot
  291.  
  292. scmcomp/boot.asm:    make-asm scmcomp/boot-c.scm
  293.     @make-asm $(ECHO_N)
  294.  
  295. scmcomp/boot-c.scm:    scmcomp/s.boot-c.scm
  296.     -(cd scmcomp; \
  297.       if [ -f s.boot-c.scm ]; then $(GET) s.boot-c.scm; else exit 0; fi)
  298.  
  299. # The following section contains stuff related to ULTRIX's
  300. # profiling system (pixie):
  301.  
  302. scheme.pixie: scheme
  303.     pixie -o scheme.pixie scheme
  304.  
  305. prof: scheme.pixie .scheme-boot
  306.     ./scheme.pixie
  307.     prof -pixie scheme | more
  308.  
  309. # Compiling a program to test the storage module:
  310. # Use the commented-out line, if malloc/realloc/free is not ANSI!
  311.  
  312. TESTOBJ = storage.o tstorage.o
  313. tstorage: $(TESTOBJ)
  314.     $(CC) -o tstorage $(LDFLAGS) $(TESTOBJ) $(LIBS)
  315. #    $(CC) -o tstorage -DBAD_REALLOC $(LDFLAGS) $(TESTOBJ) $(LIBS)
  316.